using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[DisallowMultipleComponent]
public class GameManager:SingletonMonoBehaviour<GameManager>
{


    //#region DUNGEON LEVELS

    //[Space(10)]
    //[Header("DUNGEON LEVELS")]

    //#endregion Tooltips

    //[Tooltip("Populate with the dungeon level scriptable objects")]
    //[SerializeField] private List<DungeonLevelSO> dungeonLevelList;

    //#region Tooltips

    //[Tooltip("Populate with the starting dungeon level for testing, first level = 0")]
    //[SerializeField] private int currentDungeonLevelListIndex = 0;

    //#endregion Tooltips

    [HideInInspector] public GameStateState gameState;
    public PlayerDetailsSO playerDetails;
    private Player player;

    private void Start()
    {
        gameState=GameStateState.gameStarted;
        
    }
    protected override void Awake()
    {
        
        base.Awake();
        
       
        InstantiatePlayer();
      

    }
    private void Update()
    {
        HandleGameState();
    }
    private void HandleGameState()
    {
        switch (gameState){
            case GameStateState.gameStarted:

                break;
        }
    }
    private void InstantiatePlayer()
    {
        if (playerDetails == null)
        {
            Debug.LogError("PlayerDetailsSO is not assigned in the GameManager.");
            return;
        }
        // Instantiate player
        GameObject playerGameObject = Instantiate(playerDetails.playerPrefab);

        // Initialize Player
        player = playerGameObject.GetComponent<Player>();
      

        player.Initialize(playerDetails);
        player.gameObject.transform.position = new Vector3(0f, 0f, 0f);
   
    }
    public Player GetPlayer()
    {
        return player;
    }
}
